<template>
  <a-card :bordered="false">
    <!-- 查询区域 -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="构件钢号">
              <a-input placeholder="请输入构件钢号" v-model="queryParam.steelSpecification"></a-input>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="报工单号">
              <a-input placeholder="请输入报工单号" v-model="queryParam.reportNo"></a-input>
            </a-form-item>
          </a-col>
          <template v-if="toggleSearchStatus">
            <a-col :xl="6" :lg="7" :md="8" :sm="24">
              <a-form-item label="工程编号">
                <a-input placeholder="请输入工程编号" v-model="queryParam.engineCode"></a-input>
              </a-form-item>
            </a-col>
            <a-col :xl="6" :lg="7" :md="8" :sm="24">
              <a-form-item label="工程名称">
                <a-input placeholder="请输入工程名称" v-model="queryParam.engineName"></a-input>
              </a-form-item>
            </a-col>
            <a-col :xl="6" :lg="7" :md="8" :sm="24">
              <a-form-item label="真实姓名">
                <a-input placeholder="请输入真实姓名" v-model="queryParam.realName"></a-input>
              </a-form-item>
            </a-col>
          </template>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
              <a @click="handleToggleSearch" style="margin-left: 8px">
                {{ toggleSearchStatus ? '收起' : '展开' }}
                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
              </a>
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <!-- 查询区域-END -->



    <!-- table区域-begin -->
    <div>
      <a-table
        ref="table"
        size="middle"
        :scroll="{x:true}"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
        class="j-table-force-nowrap"
        @change="handleTableChange">
      </a-table>
    </div>

    <reporting-modal ref="modalForm" @ok="modalFormOk"></reporting-modal>
  </a-card>
</template>

<script>

  import '@/assets/less/TableExpand.less'
  import { mixinDevice } from '@/utils/mixin'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import ReportingModal from './modules/ReportingModal'


  export default {
    name: "ReportingList",
    mixins:[JeecgListMixin, mixinDevice],
    components: {
      ReportingModal
    },
    data () {
      return {
        description: '报工表管理页面',
        // 表头
        columns: [
          {
            title:'报工单号',
            align:"center",
            dataIndex: 'reportNo'
          },
          {
            title:'钢号',
            align:"center",
            dataIndex: 'steelSpecification'
          },
          {
            title:'工程编号',
            align:"center",
            dataIndex: 'engineCode'
          },
          {
            title:'工程名称',
            align:"center",
            dataIndex: 'engineName'
          },{
            title:'工序代码',
            align:"center",
            dataIndex: 'procCode'
          },{
            title:'工序名称',
              align:"center",
              dataIndex: 'procName'
          },
          {
            title:'材质',
            align:"center",
            dataIndex: 'qualit'
          },
          {
            title:'位置',
            align:"center",
            dataIndex: 'location'
          },
          {
            title:'构件单重',
            align:"center",
            dataIndex: 'singleWeight'
          },
          {
            title:'构件数量',
            align:"center",
            dataIndex: 'count'
          },
          {
            title:'报工数量',
            align:"center",
            dataIndex: 'reportCount'
          },
          {
            title:'报工总重量',
            align:"center",
            dataIndex: 'reportTotalWeight'
          },
          {
            title:'合格数量',
            align:"center",
            dataIndex: 'qualifiedCount'
          },
          {
            title:'报工用户',
            align:"center",
            dataIndex: 'realName'
          },
          {
            title:'报工时间',
            align:"center",
            dataIndex: 'reportTime'
          }
        ],
        url: {
          list: "/reporting/reporting/list",
          delete: "/reporting/reporting/delete",
          deleteBatch: "/reporting/reporting/deleteBatch",
          exportXlsUrl: "/reporting/reporting/exportXls",
          importExcelUrl: "reporting/reporting/importExcel",

        },
        dictOptions:{},
      }
    },
    created() {
    },
    computed: {
      importExcelUrl: function(){
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
      },
    },
    methods: {
      initDictConfig(){
      }
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>